﻿@model MvcApplication2.Models.Register

@using MvcApplication2.Helpers

@{
    ViewBag.Title = "Register";
    ReCaptcha.PublicKey = @"6LfTHdESAAAAACFBF460cHlnwSPhw5pbh-BHvzra";
}

<h2>Rejestracja</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm()) {
    @Html.ValidationSummary(true, "Nie udało się zarejestrować.")
    <div>
        <fieldset>
            <legend>Rejestracja</legend>

            <div class="editor-label">
                @Html.LabelFor(m => m.Login)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Login)
                @Html.ValidationMessageFor(m => m.Login)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Password)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.Password)
                @Html.ValidationMessageFor(m => m.Password)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Password2)
            </div>
            <div class="editor-field">
                @Html.PasswordFor(m => m.Password2)
                @Html.ValidationMessageFor(m => m.Password2)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Email)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Email)
                @Html.ValidationMessageFor(m => m.Email)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.FirstName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.FirstName)
                @Html.ValidationMessageFor(m => m.FirstName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.LastName)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.LastName)
                @Html.ValidationMessageFor(m => m.LastName)
            </div>

            <div class="editor-label">
                @Html.LabelFor(m => m.Age)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.Age)
                @Html.ValidationMessageFor(m => m.Age)
            </div>
            
            <div class="editor-label">
                @Html.LabelFor(m => m.City)
            </div>
            <div class="editor-field">
                @Html.TextBoxFor(m => m.City)
                @Html.ValidationMessageFor(m => m.City)
            </div>

            <div class="editor-label">
                Captcha:
            </div>
            <div class="editor-field">
	            @Html.Raw(@Html.GenerateCaptcha())

                @Html.ValidationMessage("recaptcha")
            </div>

            <p>
                <input type="submit" value="Zarejestruj się" />
            </p>
        </fieldset>
    </div>
}
